package initialize

import (
	"github.com/gin-gonic/gin"
	"mxshop-api/goods-web/middlewares"
	router2 "mxshop-api/goods-web/router"
)

func Routers() *gin.Engine {
	router := gin.Default()
	//配置跨域
	router.Use(middlewares.Cors())
	//初始化路由文件
	apiGroup := router.Group("/v1")
	router2.InitBannerRouter(apiGroup)   //注册banner的路由
	router2.InitCategoryRouter(apiGroup) //注册category的路由
	router2.InitGoodsRouter(apiGroup)    //注册goods的路由
	return router
}
